package com.longlong.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;


@Component
@PropertySource("classpath:application.yml")
public class AccessTokenGzhConfig implements InitializingBean {
    @Value("${weixin.gzh.info.appid}")
    private String appid;

    @Value("${weixin.gzh.info.appsecret}")
    private String appsecret;

    @Value("${weixin.gzh.info.token}")
    private String token;

    public static String WX_OPEN_APP_ID;
    public static String WX_OPEN_APP_SECRET;
    public static String WX_OPEN_TOKEN;


    @Override
    public void afterPropertiesSet() throws Exception {
        WX_OPEN_APP_ID = appid;
        WX_OPEN_APP_SECRET = appsecret;
        WX_OPEN_TOKEN = token;
    }
}
